-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: web types #8401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: web types #8401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two small things:
yarn.lock changes after installing deps on you branch
also, when i run web-example i get:
Web Bundling failed 118ms apps/web-example/index.js (1 module)
ERROR index.js: Package subpath './babel' is not defined by "exports" in /Users/marcysia/swm/repos/react-native-reanimated/node_modules/react-strict-dom/package.json
apps/common-app/src/apps/css/examples/animations/screens/realWorldExamples/Emojis.tsx
Show resolved
Hide resolved
Are you sure? Everything is okay on my end. Moreover, if yarn.lock were stale it would've been picked up on CI. Have you tested the latest commit on the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can confirm, now everything works 🪨
Required for
Summary
This PR is an ongoing effort to reduce the impact of Reanimated and Worklets in web bundles and to simplify the logic of platform-dependent code.
The ideal solution is to have native-only files with a
.native.tsextension and web only files with just.tsextension alongside them. However, currently we also have.web.tsfiles, which can be problematic in some environments. We want to transition to.native.tsfiles gradually.This PR does a few things:
It edits TSConfigs alongside the repository. By default we specify that accepted extensions are
.native.ts,.ios.ts,.android.ts,.ts(obviously also.tsxetc.). This means that when in IDE we clickgo to sourcewe'll go to a.nativefile which is the most common use case for us. Also types for type-checking will be pulled like this.We add additional TSConfigs for web types. These extensions ignore
.native.etc. extensions and accept.webextensions. You can switch to those TSConfigs for web type-checking in your IDE.Adding type checking scripts and CI checks for web types.
Fixing (or ignoring) all current problems with web types - i.e. mismatching web and native types in Reanimated.
Amending eslint configs to properly work in this setup.
Test plan
CI